import { CheckBoxWin } from "./CheckBoxWin";
import { Alert } from "../../../../../com/mui/controls/Alert";
//class NotAutoCloseAlertWin
    
    export  class NotAutoCloseAlertWin extends CheckBoxWin
    {
        constructor(arg1: number, arg2: number)
        {
            super(arg1, arg2);
            NotAutoCloseAlertWin.curInstance = this;
            this.showCloseBtn();
            return;
        }

        protected /* override */ buttonClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (closeHandler != null) 
            {
                if (extendObj == null) 
                {
                    closeHandler(Number(arg1.target.name.substr(4)), checkBox.selected);
                }
                else 
                {
                    closeHandler(Number(arg1.target.name.substr(4)), extendObj, checkBox.selected);
                }
            }
            return;
        }

        protected /* override */ onCloseBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (closeHandler != null) 
            {
                if (extendObj == null) 
                {
                    closeHandler(Alert.CLOSE, checkBox.selected);
                }
                else 
                {
                    closeHandler(Alert.CLOSE, extendObj, checkBox.selected);
                }
                closeHandler = null;
            }
            super.onCloseBtnClickHandler(arg1);
            return;
        }

        public closeWin(): void
        {
            var loc1=0;
            if (!this.parent) 
            {
                return;
            }
            while (loc1 < allButtons.length) 
            {
                allButtons[loc1].removeEventListener(flash.events.MouseEvent.CLICK, this.buttonClickHandler);
                ++loc1;
            }
            removeDragHandleer();
            this.parent.removeChild(this);
            return;
        }

        public static /* var */curInstance: NotAutoCloseAlertWin;
    }
